using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Material.Entity;
using Material.Object;
using System.Configuration;

namespace Material.App
{
    public partial class FrmPiutangDetail : Form
    {
        public static int IdTransHDR = 0;
        private TblTransHutangDTL tblTransHutangDTL;
        private TblTransHutangDTLEntity tblTransHutangDTLEntity;
        private string connStr = ConfigurationManager.ConnectionStrings["dbconnection"].ToString();
        public FrmPiutangDetail()
        {
            InitializeComponent();

            dataGridView1.RowsDefaultCellStyle.BackColor = Color.Bisque;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.None;

            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.Green;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.Yellow;

            //dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            //dataGridView1.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;

            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;


            BindGrid();
        }

        private void BindGrid()
        {
            tblTransHutangDTL = new TblTransHutangDTL();
            tblTransHutangDTL.IdTransHDR = IdTransHDR;

            tblTransHutangDTLEntity = new TblTransHutangDTLEntity(connStr);
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = tblTransHutangDTLEntity.GetDataDSByIdHDR(IdTransHDR.ToString()).Tables[0];

        }

        private void FrmPiutangDetail_Load(object sender, EventArgs e)
        {
           
        }
    }
}